import axios from '@/libs/api.request'

export const getProductsByCondition = (condition) => {
  return axios.request({
    url: 'product',
    params: condition,
    method: 'get'
  })
}

export const getProductById = (id) => {
  return axios.request({
    url: 'product/'+id,
    method: 'get'
  })
}

export const addproduct = (product) => {
  return axios.request({
    url: 'product',
    data: product,
    method: 'post'
  })
}

export const updateStatus = (product) => {
  return axios.request({
    url: 'product/status',
    data: product,
    method: 'put'
  })
}

export const deleteProductByIds = (ids) => {
  return axios.request({
    url: 'product',
		params: {ids},
    method: 'delete'
  })
}